package smedi.ismedi.web.bff.controller;

import org.springframework.http.server.reactive.ServerHttpRequest;

/**
 * Controller抽象基类
 * 主要解决获取字典数据、访问者的原始IP、鉴权、国际化本地化等问题
 * @author YangJin
 */
public abstract class BaseController {
    /**
     * 获取原始访问的客户端IP
     * @return IP地址字符串
     */
    public String getClientIp(ServerHttpRequest httpServletRequest) {
        return httpServletRequest.getHeaders().getFirst("X-Forwarded-For");
    }
}
